package com.gc.server.entity;


import com.gc.server.enums.LevelEnum;
import com.qiniu.util.Auth;
import lombok.Setter;
import lombok.Getter;
import java.io.Serializable;
import java.util.Date;


/**
 * 用户实体
 * 表名 user
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Mar 10 11:17:45 CST 2020
 */
@Getter
@Setter
public class UserEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    //
    private Long id;
    //名称
    private String name;
    //头像
    private String avatar;
    //微信openid
    private String openId;
    //微信unionid
    private String unionId;
    //变动时间
    private Date registerTime;
    //起止时间
    Date[] registerTimes;
    //手机号码
    private String mobile;
    //级别ID
    private Long levelId;
    //编码
    private String code;
    //上级ID
    private Long pid;
    //团队编码
    private String tCode;
    //团队树
    private String team;
    //省
    private String province;
    //市
    private String city;
    //县
    private String county;
    //详情
    private String detail;
    //ENUM-状态:"ACTIVE-正常","BAN-禁用"
    private Integer status;
    //连锁名称
    private String linkName;
    //药店名称
    private String shopName;
    //药店代码
    private String shopCode;
    //描述
    private String info;
    //IMG-营业执照
    private String shopImg;
    //开户人
    private String bankUser;
    //开户账号
    private String bankNum;
    //开户行
    private String bankName;
    //开户分行
    private String bankBranch;
    //身份证
    private String idCard;
    //年龄
    private Long age;
    //性别
    private String sex;
    //学历
    private String edu;
    //专业
    private String major;
    //加入时间
    private Date joinDate;
    //起止时间
    Date[] joinDates;
    //生日
    private Date birth;
    //起止时间
    Date[] births;
    //收件地址
    private String address;
    //工作单位
    private String workUnit;
    //备注
    private String remark;
    private Long shopId;

    //是否是VIP
    private Integer vip;

    public UserEntity() {

    }




    /**
     * 基本微信信息
     *
     * @param name
     * @param avatar
     * @param openId
     */
    public UserEntity(String name, String avatar, String openId,String unionId, Long pid) {
        this.name = name;
        this.avatar = avatar;
        this.openId = openId;
        this.unionId = unionId;
        this.pid = pid;
    }

    /**
     * 客户基本信息
     *
     * @param name
     * @param avatar
     * @param openId
     * @param registerTime
     * @param levelId
     * @param code
     * @param pid
     * @param tCode
     * @param team
     * @param status
     */
    public UserEntity(String name, String avatar, String openId,String unionId, Date registerTime, Long levelId, String code, Long pid, String tCode, String team, Integer status) {
        this.name = name;
        this.avatar = avatar;
        this.openId = openId;
        this.registerTime = registerTime;
        this.levelId = levelId;
        this.code = code;
        this.pid = pid;
        this.tCode = tCode;
        this.team = team;
        this.status = status;
        this.unionId = unionId;
    }

    /**
     * 主管基本信息
     *
     * @param name
     * @param avatar
     * @param openId
     * @param registerTime
     * @param mobile
     * @param levelId
     * @param code
     * @param pid
     * @param tCode
     * @param team
     * @param status
     */
    public UserEntity(String name, String avatar, String openId,String unionId, Date registerTime, String mobile, Long levelId, String code, Long pid, String tCode, String team, Integer status,String bankUser,String bankName,String bankNum,String bankBranch,Date birth) {
        this.name = name;
        this.avatar = avatar;
        this.openId = openId;
        this.registerTime = registerTime;
        this.mobile = mobile;
        this.levelId = levelId;
        this.code = code;
        this.pid = pid;
        this.tCode = tCode;
        this.team = team;
        this.status = status;
        this.bankUser = bankUser;
        this.bankNum = bankNum;
        this.bankName = bankName;
        this.bankBranch = bankBranch;
        this.birth = birth;
        this.unionId = unionId;
    }

    /**
     * 业务员构造函数
     *
     * @param name
     * @param avatar
     * @param openId
     * @param registerTime
     * @param mobile
     * @param levelId
     * @param code
     * @param pid
     * @param tCode
     * @param team
     * @param status
     * @param bank
     * @param idCard
     * @param age
     * @param sex
     * @param edu
     * @param major
     * @param joinDate
     */
    public UserEntity(String name, String avatar, String openId,String unionId, Date registerTime, String mobile, String code, Long pid, String tCode, String team, Integer status, String bankNum,String bankUser,String bankName,String bankBranch, String idCard, Long age, String sex, String edu, String major, Date joinDate, Long levelId) {
        this.name = name;
        this.avatar = avatar;
        this.openId = openId;
        this.registerTime = registerTime;
        this.mobile = mobile;
        this.levelId = levelId;
        this.code = code;
        this.pid = pid;
        this.tCode = tCode;
        this.team = team;
        this.status = status;
        this.bankName = bankName;
        this.bankUser = bankUser;
        this.bankBranch = bankBranch;
        this.bankNum = bankNum;
        this.idCard = idCard;
        this.age = age;
        this.sex = sex;
        this.edu = edu;
        this.major = major;
        this.joinDate = joinDate;
        this.levelId = levelId;
        this.unionId = unionId;
    }

    /**
     * 药店构造函数
     *
     * @param name
     * @param avatar
     * @param openId
     * @param registerTime
     * @param mobile
     * @param levelId
     * @param code
     * @param pid
     * @param tCode
     * @param team
     * @param province
     * @param city
     * @param county
     * @param detail
     * @param status
     * @param linkName
     * @param shopName
     * @param shopCode
     * @param shopImg
     */
    public UserEntity(String name, String avatar, String openId,String unionId, Date registerTime, String mobile, Long levelId, String code, Long pid, String tCode, String team, String province, String city, String county, String detail, Integer status, String linkName, String shopName, String shopCode, String shopImg,Long shopId,Date birth) {
        this.name = name;
        this.avatar = avatar;
        this.openId = openId;
        this.registerTime = registerTime;
        this.mobile = mobile;
        this.levelId = levelId;
        this.code = code;
        this.pid = pid;
        this.tCode = tCode;
        this.team = team;
        this.province = province;
        this.city = city;
        this.county = county;
        this.detail = detail;
        this.status = status;
        this.shopId = shopId;
        this.linkName = linkName;
        this.shopName = shopName;
        this.shopCode = shopCode;
        this.shopImg = shopImg;
        this.birth = birth;
        this.unionId = unionId;
    }

    public UserEntity(String name, String avatar, Long pid, Long levelId, Date date, String openId, String unionId, String code) {
        this.name = name;
        this.avatar = avatar;
        this.pid = pid;
        this.levelId = levelId;
        this.registerTime = date;
        this.openId = openId;
        this.unionId = unionId;
        this.code = code;
    }

//    /**
//     * 地址
//     *
//     * @return
//     */
//    private String getAddress() {
//        if(this.province==null||this.province.equals(""))return null;
//        return this.province + " " + this.city + " " + this.county + " " + this.detail;
//    }

    public void setName(String name) {
        this.name = name;
    }

    public void settCode(String tCode) {
        this.tCode = tCode;
    }

    public void setTCode(String tCode) {
        this.tCode = tCode;
    }


    public static void main(String[] args) {
       String res =  Auth.create("XTvoSxHiB_VWvmtGyF6NJUi5UJOvVOajy3j-q4q-","LXpHU_JyTmCNREH3ixUVvZdqdh4R_wnuVEqs6iWs").uploadToken("scyy2021",null,3600*24*365*10,null);
        System.out.println(res);
    }
}
